# -*- coding: utf-8 -*-

from openerp import models, fields, api

class account_analytic_account(models.Model):
    _inherit = 'account.analytic.account'

    state=fields.Selection([
        ('template', 'Template'),
        ('draft','New'),
        ('open','In Progress'),
        ('pending','To Renew'),
        ('close','Closed'),
        ('cancelled', 'Cancelled'),
        ('confirmed','Confirmed'),
        ('marketconfirmed','MarketConfirmed'),
        ('saleconfirmed','SaleConfirmed'),
        ('financialconfirmed','FinancialConfirmed'),
        ('lawyerconfirmed','LawyerConfirmed'),
        ('managerconfirmed','ManagerConfirmed')],default='draft')
    
    @api.one
    def action_draft(self):
        self.sudo().write({'state':'draft'})

    @api.one
    def action_confirm(self):
        self.state = 'confirmed'

    @api.one
    def action_marketconfirm(self):
        self.state = 'marketconfirmed'

    @api.one
    def action_saleconfirm(self):
        self.state = 'saleconfirmed'

    @api.one
    def action_financialconfirm(self):
        self.state = 'financialconfirmed'

    @api.one
    def action_lawyerconfirm(self):
        self.state = 'lawyerconfirmed'

    @api.one
    def action_managerconfirm(self):
        self.state = 'open'
